package com.zm;

import config.SpringConfiguration;
import com.zm.services.IAcountServices;
import com.zm.testbean.Diclass;
import org.apache.commons.dbutils.QueryRunner;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {

        @Test
        public void testMain(){
            ApplicationContext app=new ClassPathXmlApplicationContext("Application.xml");
            IAcountServices ace=(IAcountServices)app.getBean("AccountServicesImpl");
            ace.findAllAccount();
            System.out.println(ace+"-------------------");
            Diclass di=(Diclass) app.getBean("Diclass");
            System.out.println(di);

            di.accountSaveMethod();
        }
        @Test
        public void testAnno(){
            //ApplicationContext app=new ClassPathXmlApplicationContext("Application.xml");
            ApplicationContext app=new AnnotationConfigApplicationContext(SpringConfiguration.class);
            IAcountServices as=(IAcountServices) app.getBean("AccountServicesImpl");
            System.out.println(as);
            as.findAllAccount();

        }

}
